package com.mzj.saas.mservice.idcard.controller;

import com.mzj.saas.commons.ResultBean;
import com.mzj.saas.mservice.idcard.service.IdcardService;
import com.mzj.saas.mservice.idcard.vo.IdcardVO;
import com.mzj.saas.mservice.idcard.vo.OcrIdcardVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 身份证识别
 */
@Controller
@RequestMapping("idcard")
public class IdcardController {
    @Autowired
    private IdcardService IdcardService;


    /**
     * 身份证识别
     * @type 申请类型：1个人 2单位
     * @userType 用户类型：1承租人 2同住人
     * @param accessToken
     * @return
     */
    @PostMapping
    @ResponseBody
    public ResultBean<IdcardVO> idcard(@RequestHeader String accessToken, @RequestBody OcrIdcardVO vo) {
        return IdcardService.idcardToAppCode(accessToken, vo.getPath(), vo.getSide(), vo.getType(), vo.getUserType());
    }


}
